package in.muton.edushare.grading.panels.prevgrades.old;

import in.muton.edushare.grading.panels.studentGrades.GradingUtil;
import in.muton.edushare.grading.panels.studentGrades.GradingUtil.CourseGradeHelper;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;

import com.edushare.common.vo.CourseInstances;
import com.edushare.common.vo.Users;

public class CourseGradeLabel extends Label {
	private IModel<Users> userModel;
	private IModel<CourseInstances> courseModel;
	private GradingUtil gUtil;

	public CourseGradeLabel(String id, IModel<Users> user,
			IModel<CourseInstances> cInst) {
		super(id);
		setDefaultModel(new GradeModel());
		this.userModel = user;
		this.courseModel = cInst;
		gUtil = new GradingUtil(courseModel);
	}
	
	private class GradeModel extends Model<String>{
		@Override
		public String getObject(){
			CourseGradeHelper cgh = gUtil.getGrades(userModel.getObject());
			return cgh.temp;
		}
		private static final long serialVersionUID = -8800993434031012091L;
	}

	private static final long serialVersionUID = -7891540737637272146L;
}
